<?php
namespace BoxApi\Controller;

use Think\Controller;

class CommonController extends \HomeController {
	public function _initialize() {
		parent::_initialize();

	}

	//
	public function CheckAppSecret() {
		$AppSecret = I('AppSecret');
		$AppId = I('AppId');
		if (empty($AppId)) {
			exit(json_encode(array('error' => 1, 'msg' => "AppId不能为空")));
		}
		if (empty($AppSecret)) {
			exit(json_encode(array('error' => 2, 'msg' => " AppSecret 不能为空")));
		}

		if ($AppId != "100002") {
			exit(json_encode(array('error' => 3, 'msg' => "appid 不正确")));
		}
		if ($AppSecret != "1e88707f00e11e0ce3e76c60e323dd0c") {
			exit(json_encode(array('error' => 4, 'msg' => "AppSecret 不正确")));
		}
		Logs("BoxApi", array('name' => $_SERVER['PATH_INFO'], 'params' => I()));

	}

}